package test.study02;

public class Study02 {

    public static void main(String[] args) {
        System.out.println(isPowerOfTwo(4));
    }

    //判断是否事2的幂
    public static boolean isPowerOfTwo(int n) {
        if ( n < 1){
            return false;
        }
        return (n&(n-1)) == 0;
    }
}
